class Solution:
    def findTheLongestSubstring(self, s: str) -> int:
        ans, status = 0, 0
        pos = [0] + [-1] * 31

        for i, letter in enumerate(s):
            if letter in 'aeiou':
                status ^= 1 << 'aeiou'.index(letter)

            if pos[status] == -1:
                pos[status] = i + 1
            else:
                ans = max(ans, i + 1 - pos[status])

        return ans
